package com.example.haoqisystem.entity;

import com.example.haoqisystem.Annotation.ExcelAnnotation;
import com.example.haoqisystem.Annotation.WordAnnotation;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import javax.xml.ws.WebEndpoint;
import java.util.Date;

@Entity
@Data
@DynamicUpdate
@Table(name = "registration_form")
public class RegistrationForm {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "自增主键")
    private Long id;

    @Temporal(TemporalType.TIMESTAMP)
    @CreationTimestamp
    @Column(nullable = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @Temporal(TemporalType.TIMESTAMP)
    @UpdateTimestamp
    @Column(nullable = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;

    @Column(insertable = false,nullable = false,length = 1,columnDefinition = "bit default 0")
    @ApiModelProperty(value = "逻辑删除 0：正常 1：删除")
    private Boolean deleted;

    @ApiModelProperty(value = "课程id")
    private Long lectureId;

    @ApiModelProperty(value = "课程名")
    private String lectureName;

    @Column(length = 20)
    @ApiModelProperty(value = "姓名")
    @ExcelAnnotation(exportName = "学员姓名")
    @WordAnnotation(exportName = "学员姓名")
    private String name;

    @ApiModelProperty(value = "性别(男，女)")
    @ExcelAnnotation(exportName = "性别")
    @WordAnnotation(exportName = "性别")
    private String gender;

    @Column(length = 20)
    @ApiModelProperty(value = "公司名")
    @ExcelAnnotation(exportName = "公司名")
    @WordAnnotation(exportName = "公司名")
    private String companyName;

    @Column(length = 20)
    @ApiModelProperty(value = "工作岗位")
    @ExcelAnnotation(exportName = "工作岗位")
    @WordAnnotation(exportName = "工作岗位")
    private String workPosition;

    @Column(length = 20)
    @ApiModelProperty(value = "技术水平")
    @ExcelAnnotation(exportName = "技术水平")
    @WordAnnotation(exportName = "技术水平")
    private String technicalLevel;

    @ApiModelProperty(value = "邮箱")
    @WordAnnotation(exportName = "邮箱")
    @ExcelAnnotation(exportName = "邮箱")
    private String email;

    @ApiModelProperty(value = "期待得到的收获")
    @WordAnnotation(exportName = "期待得到的收获")
    private String expectObtain;

    @Column(length = 1,columnDefinition = "bit default 0")
    @ApiModelProperty(value = "是否付费")
    @ExcelAnnotation(exportName = "是否付费")
    private Boolean isPay;

    @Column(length = 1,columnDefinition = "bit default 0")
    @ApiModelProperty(value = "是否签到")
    @ExcelAnnotation(exportName = "是否签到")
    private Boolean isChecked;

    @Column(length = 1,columnDefinition = "bit default 0")
    @ApiModelProperty(value = "是否领取资料")
    @ExcelAnnotation(exportName = "是否领取资料")
    private Boolean isObtainedMaterial;
}
